﻿using G04P1_LogikaBiznesowa;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace G04P1_Interface
{
    class DataInputViewModel2 : INotifyPropertyChanged
    {
        G04P1_LogikaBiznesowa.NorthwindEntities baza = new NorthwindEntities();
        int _priceValue2;
        public int PriceValue2
        {
            get { return _priceValue2; }

            set
            {
                _priceValue2 = value;
                Produkty = baza.Products.Where(l => l.UnitPrice < PriceValue2).ToList();
                NotifyPropertyChanged("PriceValue2");
                NotifyPropertyChanged("Produkty");

            }
        }
        public IList<Products> Produkty
        {
            get;
            set;

        }

        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
    }
}
